﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace HobSoft.SoccerBet2014.Domain.Models.DbSchema
{
    public class GameMappingConfiguration : EntityTypeConfiguration<GameMapping>
    {
        public GameMappingConfiguration(string schema = "dbo")
        {
            ToTable(schema + ".MatchMapping");
            Property(g => g.Key).HasColumnName("MappingID").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).IsRequired();
            Property(g => g.EventID).HasColumnName("BFEventID").IsRequired();
            Property(g => g.BmID).HasColumnName("BookerID").IsRequired();
            Property(g => g.GameID).HasColumnName("MatchID").IsRequired().HasMaxLength(50).IsUnicode(false);
            Property(g => g.TeamReversal).HasColumnName("TeamReversal").IsOptional();
            Property(g => g.LastUpdateTime).HasColumnName("CreateTime").IsOptional();
            HasKey(g => g.Key);
        }
    }
}
